Skip to content

streamline layout and enhance community social proof#226

Open
IanoNjuguna wants to merge 3 commits into
IntersectMBO:mainfrom
IanoNjuguna:devex-stats_ian
Open

streamline layout and enhance community social proof#226
IanoNjuguna wants to merge 3 commits into
IntersectMBO:mainfrom
IanoNjuguna:devex-stats_ian

Conversation

@IanoNjuguna
Copy link
Copy Markdown
Contributor

@IanoNjuguna IanoNjuguna commented May 3, 2026

The purpose of this PR is to make the Community Section more engaging.

Related to #218

Type of Change

Check the type of change this PR introduces:

  • Bug fix (non-breaking change that fixes an issue)
  • New feature (non-breaking change that adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update
  • Refactor (improves code structure or readability without changing functionality)
  • Other (please describe):

Changes Made

devex
  1. Created a new Contributors.tsx component that dynamically fetches and displays real-time contributor data from the GitHub API.
  2. Implemented a filtering system in the contributors list to automatically exclude automated bot accounts and Dependabot.
  3. Integrated the Contributors component into the CommunitySection layout between the description paragraph and action buttons.
  4. Updated the section heading and description copy to focus on community assistance and suggesting improvements.
  5. Added the all-time repository pulse on the right half of the section.

Checklist

Ensure you have completed the following steps before submitting your PR:

  • My code follows the project's coding style and guidelines.
  • I have performed a self-review of my own code.
  • I have commented my code, particularly in hard-to-understand areas.
  • I have updated the documentation (if applicable).
  • My changes generate no new warnings or errors.
  • I have added tests that prove my fix is effective or that my feature works.
  • I have checked for merge conflicts.
  • I have rebased my branch onto the latest main or master branch.

@IanoNjuguna IanoNjuguna requested a review from Ranchhand87 as a code owner May 3, 2026 17:20
@Emmanuel-Tyty Emmanuel-Tyty self-requested a review May 6, 2026 07:16
@HarunJr HarunJr self-requested a review May 12, 2026 13:14
Copy link
Copy Markdown
Contributor

@HarunJr HarunJr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for putting this together. The visual design and the use of live data look fantastic!
I have a few architectural notes to help us polish this up before merging:

  1. Lockfiles (website/bun.lock & website/yarn.lock) It looks like bun was used locally. This project strictly uses yarn, so committing bun.lock could cause confusion for other contributors and break our CI.
  • Suggestion: Please delete bun.lock, run yarn install to cleanly restore yarn.lock, and update the PR.

I have highlighted some Rate limit issues and some nick picks before. other than that I have a few nit picks on the UI design.

  1. For consistency and visual pull poposes purposes, kindly restore the rounded joint intersect to the original orange rounded corner and center it since you have removed the other Visit GitHub Repository from this location.

The goal is for this to be the primary button visitors want to click on, so it should be a different colot i.e: Orange for Prominence.

Image
  1. As the Scondary button, again, we can maintain the rounded corners but consider having this button lead to the issues page like your initial PR. Seeing as it is a secondary button, consider having it white. This should direct the visitor's eyes after the join intersect button.
Image


useEffect(() => {
const repo = 'IntersectMBO/developer-experience';
fetch(`https://api.github.com/repos/${repo}/contributors`)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Currently this fetches data directly from the GitHub API on the client side. Unauthenticated requests to /contributors are limited to 60 requests/hour, and the Search API is even stricter at 10 requests/minute. In a production environment, just a few concurrent visitors will quickly exhaust this limit and break the stats.

Link: GitHub Docs: Primary rate limit for unauthenticated users

async function fetchPulse() {
try {
// Fetching from GitHub Search API to get aggregate counts
const [prsRes, openIssuesRes, closedIssuesRes] = await Promise.all([
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just like the previuous comment. This also fetches directly from GitHub. Kindly look into the rate limit issue.

For both cases consider fetching this data at build time instead. Write a prebuild script to save the data to a local JSON file, then have the components import that JSON. Let me know if you need help setting this up!

import styles from './styles.module.css';

export default function Contributors() {
const [contributors, setContributors] = useState<any[]>([]);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The any type is used for contributor data.

Consider defining a minimal interface (e.g., interface Contributor { login: string; avatar_url: string; html_url: string; }) to keep types strict.

.then(response => response.json())
.then(data => {
if (Array.isArray(data)) {
const validContributors = data.filter((user: any) =>
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same here. Let's refrain using any in favour of propper typed types.

return (
<div className={styles.contributorsContainer}>
<div className={styles.contributorsList}>
{contributors.map((user: any) => (
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refer to previuous comments on the use any.

.catch(error => console.error('Error fetching contributors:', error));
}, []);

if (contributors.length === 0) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loading states are handled, but network failures are not.
Consider adding a fallback error state so the UI doesn't silently break or hang if a fetch fails

openIssues: openIssues.total_count !== undefined ? openIssues.total_count : '-',
closedIssues: closedIssues.total_count !== undefined ? closedIssues.total_count : '-'
});
} catch (error) {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Loading states are handled, but network failures are not.

Consider adding a fallback error state so the UI doesn't silently break or hang if a fetch fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants